<!--  -->
<template>
  <div>
    center
    <origin :innerText="innerText"></origin>
    <vtab :active="3"></vtab>
  </div>
</template>

<script>
import Vatabbar from '../commponents/tabbar/vatabbar'
import Paging from '../../utils/paging'
import { getComents } from '../../api/comment'
export default {
  name: '',
  components: {
    'vtab': Vatabbar
  },
  data () {
    return {
      innerText: '原生组件',
      comments: [],
      handle: {},
      isEnd: false,
      route: [{
        name: '建议',
        tab: 'advise'
      },
      {
        name: '修改',
        tab: 'eit'
      }
      ]
    }
  },
  async onLoad () {
    this._getdetail()
    this.handle = new Paging(getComents, {
      tid: '61ea23a0b9ea5b280f8a2306'
    })
    // const result = await this.handle.next()
    this.comments = await this.handle.next()
    this.isEnd = this.handle.getIsEnd()
    // console.log('result1', result1)
  },
  computed: {},
  async onReachBottom () { // 滚最下面加载评论
    this.comments = await this.handle.next()
  },

  mounted () { },

  methods: {
    _getdetail () {
      getComents({ tid: '61ea23a0b9ea5b280f8a2306' }).then((res) => {
        console.log(res)
      })
    }
  }
}
</script>
<style scoped  >
</style>